<?php

defined('MYLITS') ? '' : exit('No direct script access allowed');

/**
 * @version     1.0.0
 * @package     mylits engine
 * @license     GNU General Public License version 3
 * @author      Arfan Fudyartanto D N <arfan@mylits.com> - http://engine.mylits.com
 */
class loginController extends Mylits_Controller {

    public function __construct() {
        parent::__construct();
        $this->setPublic(true);
    }

    public function view() {
        $result = '';
        if ($this->task == 'do.logout') {
            $result = $this->executeProcess('do', 'logout');
        } else if ($this->task == 'do.login') {
            $result = $this->executeProcess('do', 'login');
        } else {
            $user = Mylits_User::getInstance();
            if ($user::$guest) {
                $result = $this->executeProcess('view', 'login');
            } else {
                $result = $this->executeProcess('view', 'userinfo');
            }
        }
        return $result;
    }

}

?>
